<template>
  <el-config-provider :locale="locale" :size="size">
    <el-watermark :font="{ color: fontColor }" :content="content" :z-index="9999" class="wh-full">
      <router-view />
    </el-watermark>
  </el-config-provider>
</template>

<script setup lang="ts">
import { useAppStore, useSettingsStore } from '@/store';
import { SizeEnum } from '@/enums';

const appStore = useAppStore();
const settingsStore = useSettingsStore();

const locale = computed(() => appStore.locale);
const size = computed(() => appStore.size as SizeEnum);

const content = computed(() => (settingsStore.watermarkEnabled ? settingsStore.watermarkContent : ''));

const isDark = computed(() => settingsStore.isDark);

// 明亮/暗黑主题水印字体颜色适配
const fontColor = computed(() => (isDark.value ? 'rgba(255, 255, 255, .15)' : 'rgba(0, 0, 0, .15)'));
</script>
